package com.fz.study.project.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result implements Serializable {

    private static final long serialVersionUID =1L;

    private Boolean code;
    private String msg;
    private Object data;

    public static Result success(){
        return new Result(true,"success",null);
    }

    public static Result success(Object data){
        return new Result(true,"success",data);
    }

    public static Result error(String msg){
        return new Result(false,msg,null);
    }
}
